<?php
    include APPLICATION_PATH . '/application/views/head.phtml';
    include APPLICATION_PATH . '/application/views/top.phtml';
    include APPLICATION_PATH . '/application/views/left.phtml';
?>
    <script src="/public/pagejs/authority_list1.js"></script>

<div id="thispage" data-id="23"></div>


		<!-- BEGIN PAGE -->

		<div class="page-content">

			<!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->

			<div id="portlet-config" class="modal hide">

				<div class="modal-header">

					<button data-dismiss="modal" class="close" type="button"></button>

					<h3>portlet Settings</h3>

				</div>

				<div class="modal-body">

					<p>Here will be a configuration form</p>

				</div>

			</div>

			<!-- END SAMPLE PORTLET CONFIGURATION MODAL FORM-->

			<!-- BEGIN PAGE CONTAINER-->        

			<div class="container-fluid">

				<!-- BEGIN PAGE HEADER-->

				<div class="row-fluid">

					<div class="span12">

						<!-- BEGIN STYLE CUSTOMIZER -->

						<div class="color-panel hidden-phone">

							<!-- <div class="color-mode-icons icon-color"></div> -->

							<div class="color-mode-icons icon-color-close"></div>

							<div class="color-mode">

								<p>THEME COLOR</p>

								<ul class="inline">

									<li class="color-black current color-default" data-style="default"></li>

									<li class="color-blue" data-style="blue"></li>

									<li class="color-brown" data-style="brown"></li>

									<li class="color-purple" data-style="purple"></li>

									<li class="color-grey" data-style="grey"></li>

									<li class="color-white color-light" data-style="light"></li>

								</ul>

								<label>

									<span>Layout</span>

									<select class="layout-option m-wrap small">

										<option value="fluid" selected>Fluid</option>

										<option value="boxed">Boxed</option>

									</select>

								</label>

								<label>

									<span>Header</span>

									<select class="header-option m-wrap small">

										<option value="fixed" selected>Fixed</option>

										<option value="default">Default</option>

									</select>

								</label>

								<label>

									<span>Sidebar</span>

									<select class="sidebar-option m-wrap small">

										<option value="fixed">Fixed</option>

										<option value="default" selected>Default</option>

									</select>

								</label>

								<label>

									<span>Footer</span>

									<select class="footer-option m-wrap small">

										<option value="fixed">Fixed</option>

										<option value="default" selected>Default</option>

									</select>

								</label>

							</div>

						</div>

						<!-- END BEGIN STYLE CUSTOMIZER -->  

						<!-- BEGIN PAGE TITLE & BREADCRUMB-->

						<h3 class="page-title">
							权限列表
						</h3>

						<ul class="breadcrumb">
							<li>
								<i class="icon-home"></i>
								<span>当前位置：</span>
								<span>首页</span>
								<i class="icon-angle-right"></i>
							</li>
							<li>
								<span>用户管理</span>
								<i class="icon-angle-right"></i>
							</li>
							<li><span>权限列表</span></li>
						</ul>

						<!-- END PAGE TITLE & BREADCRUMB-->

					</div>

				</div>

				<!-- END PAGE HEADER-->

				<!-- BEGIN PAGE CONTENT-->

				<div class="row-fluid">

					<div class="span6 responsive" data-tablet="span12 fix-offset" data-desktop="span6" style="width:100%;">

						<!-- BEGIN EXAMPLE TABLE PORTLET-->

						<div class="portlet box grey">

							<div class="portlet-title">

								<div class="caption"><i class="icon-user"></i>权限列表</div>

								<div class="actions controls">

									<a href="#form_modal_tj"  data-toggle="modal" data-target="#form_modal_tj" class="btn blue"><i class="icon-pencil"></i> 添加</a>

								</div>

							</div>

							<div class="portlet-body">

								<table class="table table-striped table-bordered table-hover" id="current_table">

									<thead>

										<tr>
											<th>权限名</th>
											<th>组名</th>
											<th>控制器</th>
											<th>动作</th>
											<th>描述</th>
											<th>操作</th>
										</tr>

									</thead>

									<tbody id="tbody">
<?php
    foreach ($list as $k => $v) {
        $style = (0 == ($k % 2)) ? 'odd' : 'even';
        echo <<< EOF
										<tr class="{$style} gradeX">

											<td>{$v['name']}</td>
											<td>{$v['module']}</td>
											<td>{$v['controller']}</td>
											<td>{$v['action']}</td>
											<td>{$v['remark']}</td>
											<td><a class="tableDelete" href="/Authority/del/id/{$v['authority_id']}">删除</a> / <a class="tableEdit" href="/Authority/edit/id/{$v['authority_id']}">修改</a></td>
										</tr>
EOF;
    }
?>
									</tbody>

                </table>
                <div id="pages">
<?php
    if($list[0]['rows']/$list[0]['every_page']<=1)
        {
            
        }
        else
        {
            print_r($allpage);
        }
?>
</div>

							</div>

						</div>
                        
                        		<div id="form_modal_tj" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel3" aria-hidden="true">

									<div class="modal-header">

										<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>

										<h3 id="myModalLabel3">添加权限</h3>

									</div>

									<div class="modal-body">

										<form action="#" id="form_authority_add" method="post" class="form-horizontal">

											<div class="control-group">

												<label class="control-label">权限名</label>

												<div class="controls">

													<input type="text" class="colorpicker-default m-wrap" name="name" value="">

												</div>

											</div>

											<div class="control-group hide">

												<label class="control-label">组名</label>

												<div class="controls">

													<input type="text" class="colorpicker-default m-wrap" name="module" value="Index">

												</div>

											</div>
											<div class="control-group">

												<label class="control-label">控制器</label>

												<div class="controls">

													<input type="text" class="colorpicker-default m-wrap" name="controller" value="">

												</div>

											</div>
											<div class="control-group">

												<label class="control-label">动作</label>

												<div class="controls">

													<input type="text" class="colorpicker-default m-wrap" name="action" value="">

												</div>

											</div>
											<div class="control-group">

												<label class="control-label">描述</label>

												<div class="controls">

													<textarea class="colorpicker-default m-wrap" name="remark"></textarea>

												</div>

											</div>


										</form>

									</div>

									<div class="modal-footer">

										<button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>

										<button class="btn green btn-primary" id="submit_form" data-dismiss="modal" >提交</button>
                                        
									</div>

								</div><div id="form_modal_edit" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel3" aria-hidden="true">

									<div class="modal-header">

										<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>

										<h3 id="myModalLabel3">修改权限</h3>

									</div>

									<div class="modal-body">

										<form action="#" id="form_authority_edit" method="post" class="form-horizontal">

											<div class="control-group">

												<label class="control-label">权限名</label>

												<div class="controls">

													<input type="text" class="colorpicker-default m-wrap" name="name" value="">

												</div>

											</div>

											<div class="control-group hide">

												<label class="control-label">组名</label>

												<div class="controls">

													<input type="text" class="colorpicker-default m-wrap" name="module" value="">

												</div>

											</div>
											<div class="control-group">

												<label class="control-label">控制器</label>

												<div class="controls">

													<input type="text" class="colorpicker-default m-wrap" name="controller" value="">

												</div>

											</div>
											<div class="control-group">

												<label class="control-label">动作</label>

												<div class="controls">

													<input type="text" class="colorpicker-default m-wrap" name="action" value="">

												</div>

											</div>
											<div class="control-group">

												<label class="control-label">描述</label>

												<div class="controls">

													<textarea class="colorpicker-default m-wrap" name="remark"></textarea>

												</div>

											</div>


										</form>

									</div>

									<div class="modal-footer">

										<button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>

										<button class="btn green btn-primary" id="edit_form" data-dismiss="modal" >提交</button>
                                        
									</div>

								</div>

						<!-- END EXAMPLE TABLE PORTLET-->

					</div>

				</div>

				<!-- END PAGE CONTENT-->

			</div>

			<!-- END PAGE CONTAINER-->

		</div>

    <!-- END PAGE -->

	</div>

	<!-- END CONTAINER -->

	<!-- BEGIN FOOTER -->

	<?php
    include APPLICATION_PATH . '/application/views/foot.phtml';
?>
